import { createRouter, createWebHistory } from 'vue-router';

import Home from '../components/home.vue'
import AdminLogin from '../components/adminlogin.vue'
import student from '../components/studentlogin.vue'
import register from '../components/registstudent.vue'
import index from '../components/index.vue'
import panel from '../components/panel-list.vue';
import updatestudentpassword from '../components/updatestudentpassword.vue';
import bod from '../components/bod.vue';
import adminindex from '../components/adminindex.vue'
import adminpanel from '../components/adminpanel.vue'
import studentlist from '../components/studentlist.vue';
import eamlist from '../components/eamlist.vue';
import editsudent from '../components/editsudent.vue';
import prompt from '../components/prompt.vue';

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '',
            component: Home,
        },
        {
            path: '/admin',
            component: AdminLogin
        },
        {
            path: '/register',
            component: register
        },
        {
            path: '/student',
            component: student
        },
        {
            path: '/index',
            component: index,
            children: [
                {
                    path: '',
                    component: bod,
                    children: [
                        {
                            path: '',
                            component: panel
                        },
                        {
                            path: '/updatepassword',
                            component: updatestudentpassword
                        }
                    ]
                }
            ]
        },{
            path: '/adminindex',
            component: adminindex,
            children: [
                {
                    path:'',
                    component: adminpanel,
                    children:[
                        {
                            path:'/adminindex',
                            component: studentlist
                        },{
                            path:'/eamlist',
                            component: eamlist
                        },{
                            path:'/adminindex/:id',
                            component: editsudent
                        }
                    ]
                }
            ]
        },{
            path:'/prompt',
            component: prompt
        }

    ],
});

export default router;